package com.taobao.txc.resourcemanager.b;

import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.TxcContext;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLXML;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;

public class e
  extends h
  implements com.taobao.txc.resourcemanager.b.a.c
{
  private static final LoggerWrap d = LoggerInit.logger;
  private static final com.taobao.txc.resourcemanager.a.c<Integer> e = new com.taobao.txc.resourcemanager.a.c(com.taobao.txc.resourcemanager.b.b.c.a());
  private static final com.taobao.txc.resourcemanager.a.c<int[]> f = new com.taobao.txc.resourcemanager.a.c(com.taobao.txc.resourcemanager.b.b.a.a());
  private static final com.taobao.txc.resourcemanager.a.c<ResultSet> g = new com.taobao.txc.resourcemanager.a.c(com.taobao.txc.resourcemanager.b.b.b.a());
  private ArrayList<Object>[] h = null;
  
  public int a()
  {
    int i = b();
    if (i == 0) {
      return 0;
    }
    ArrayList[] arrayOfArrayList = c();
    if (arrayOfArrayList.length > 0) {
      return arrayOfArrayList[0].size();
    }
    return 0;
  }
  
  public int b()
  {
    return getParameterMetaData().getParameterCount();
  }
  
  public Object a(int paramInt1, int paramInt2)
  {
    try
    {
      Object localObject = null;
      ArrayList[] arrayOfArrayList = c();
      if (arrayOfArrayList.length >= paramInt1) {
        localObject = arrayOfArrayList[(paramInt1 - 1)];
      }
      if ((localObject == null) || (localObject.size() < paramInt2)) {
        return null;
      }
      return localObject.get(paramInt2 - 1);
    }
    catch (Throwable localThrowable)
    {
      d.a(String.format("paraIndex:%d,valueIndex:%d", new Object[] { Integer.valueOf(paramInt1), Integer.valueOf(paramInt2) }), com.taobao.txc.common.b.b.aV, localThrowable);
      if ((localThrowable instanceof SQLException)) {
        throw ((SQLException)localThrowable);
      }
      throw new SQLException(localThrowable);
    }
  }
  
  public synchronized ArrayList<Object>[] c()
  {
    if (this.h == null)
    {
      int i = b();
      this.h = new ArrayList[i];
      for (int j = 0; j < i; j++) {
        this.h[j] = new ArrayList();
      }
    }
    return this.h;
  }
  
  public String d()
  {
    int i = b();
    int j = a();
    StringBuilder localStringBuilder = new StringBuilder();
    int k = 1;
    for (int m = 1; m <= j; m++)
    {
      if (k == 1) {
        k = 0;
      } else {
        localStringBuilder.append(",");
      }
      localStringBuilder.append("[");
      int n = 1;
      for (int i1 = 1; i1 <= i; i1++)
      {
        Object localObject = a(i1, m);
        if (localObject != null)
        {
          if (n == 1) {
            n = 0;
          } else {
            localStringBuilder.append(",");
          }
          localStringBuilder.append(localObject);
        }
      }
      localStringBuilder.append("]");
    }
    return localStringBuilder.toString();
  }
  
  public e(Statement paramStatement, com.taobao.txc.resourcemanager.b.a.a parama, String paramString)
  {
    super(paramStatement, parama);
    a(paramString);
  }
  
  private void a(int paramInt, Object paramObject1, Object paramObject2, Object paramObject3)
  {
    ArrayList[] arrayOfArrayList = c();
    if (arrayOfArrayList.length >= paramInt) {
      arrayOfArrayList[(--paramInt)].add(paramObject1);
    }
  }
  
  private void a(int paramInt, Object paramObject1, Object paramObject2)
  {
    ArrayList[] arrayOfArrayList = c();
    if (arrayOfArrayList.length >= paramInt) {
      arrayOfArrayList[(--paramInt)].add(paramObject1);
    }
  }
  
  private void a(int paramInt, Object paramObject)
  {
    ArrayList[] arrayOfArrayList = c();
    if (arrayOfArrayList.length >= paramInt) {
      arrayOfArrayList[(--paramInt)].add(paramObject);
    }
  }
  
  public void addBatch()
  {
    ((PreparedStatement)this.b).addBatch();
  }
  
  public void clearParameters()
  {
    ((PreparedStatement)this.b).clearParameters();
  }
  
  public boolean execute()
  {
    if ((!TxcContext.j()) || (!com.taobao.txc.common.d.a.a())) {
      return ((PreparedStatement)this.b).execute();
    }
    if (com.taobao.txc.parser.b.b.a(this.a))
    {
      executeQuery();
      return true;
    }
    executeUpdate();
    return false;
  }
  
  public ResultSet executeQuery()
  {
    if ((!TxcContext.j()) || (!com.taobao.txc.common.d.a.a())) {
      return ((PreparedStatement)this.b).executeQuery();
    }
    return (ResultSet)g.a(this.c, this, "executeQuery", new Object[0]);
  }
  
  public int[] executeBatch()
  {
    if ((!TxcContext.j()) || (!com.taobao.txc.common.d.a.a())) {
      return ((PreparedStatement)this.b).executeBatch();
    }
    return (int[])f.a(this.c, this, "executeBatch", new Object[0]);
  }
  
  public int executeUpdate()
  {
    if ((!TxcContext.j()) || (!com.taobao.txc.common.d.a.a())) {
      return ((PreparedStatement)this.b).executeUpdate();
    }
    return ((Integer)e.a(this.c, this, "executeUpdate", new Object[0])).intValue();
  }
  
  public ResultSetMetaData getMetaData()
  {
    return ((PreparedStatement)this.b).getMetaData();
  }
  
  public ParameterMetaData getParameterMetaData()
  {
    return ((PreparedStatement)this.b).getParameterMetaData();
  }
  
  public void setArray(int paramInt, Array paramArray)
  {
    a(paramInt, paramArray);
    ((PreparedStatement)this.b).setArray(paramInt, paramArray);
  }
  
  public void setAsciiStream(int paramInt, InputStream paramInputStream)
  {
    a(paramInt, paramInputStream);
    ((PreparedStatement)this.b).setAsciiStream(paramInt, paramInputStream);
  }
  
  public void setAsciiStream(int paramInt1, InputStream paramInputStream, int paramInt2)
  {
    a(paramInt1, paramInputStream, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setAsciiStream(paramInt1, paramInputStream, paramInt2);
  }
  
  public void setAsciiStream(int paramInt, InputStream paramInputStream, long paramLong)
  {
    a(paramInt, paramInputStream, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setAsciiStream(paramInt, paramInputStream, paramLong);
  }
  
  public void setBigDecimal(int paramInt, BigDecimal paramBigDecimal)
  {
    a(paramInt, paramBigDecimal);
    ((PreparedStatement)this.b).setBigDecimal(paramInt, paramBigDecimal);
  }
  
  public void setBinaryStream(int paramInt, InputStream paramInputStream)
  {
    a(paramInt, paramInputStream);
    ((PreparedStatement)this.b).setBinaryStream(paramInt, paramInputStream);
  }
  
  public void setBinaryStream(int paramInt1, InputStream paramInputStream, int paramInt2)
  {
    a(paramInt1, paramInputStream, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setBinaryStream(paramInt1, paramInputStream, paramInt2);
  }
  
  public void setBinaryStream(int paramInt, InputStream paramInputStream, long paramLong)
  {
    a(paramInt, paramInputStream, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setBinaryStream(paramInt, paramInputStream, paramLong);
  }
  
  public void setBlob(int paramInt, Blob paramBlob)
  {
    a(paramInt, paramBlob);
    ((PreparedStatement)this.b).setBlob(paramInt, paramBlob);
  }
  
  public void setBlob(int paramInt, InputStream paramInputStream)
  {
    a(paramInt, paramInputStream);
    ((PreparedStatement)this.b).setBlob(paramInt, paramInputStream);
  }
  
  public void setBlob(int paramInt, InputStream paramInputStream, long paramLong)
  {
    a(paramInt, paramInputStream, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setBlob(paramInt, paramInputStream, paramLong);
  }
  
  public void setBoolean(int paramInt, boolean paramBoolean)
  {
    a(paramInt, Boolean.valueOf(paramBoolean));
    ((PreparedStatement)this.b).setBoolean(paramInt, paramBoolean);
  }
  
  public void setByte(int paramInt, byte paramByte)
  {
    a(paramInt, Byte.valueOf(paramByte));
    ((PreparedStatement)this.b).setByte(paramInt, paramByte);
  }
  
  public void setBytes(int paramInt, byte[] paramArrayOfByte)
  {
    a(paramInt, paramArrayOfByte);
    ((PreparedStatement)this.b).setBytes(paramInt, paramArrayOfByte);
  }
  
  public void setCharacterStream(int paramInt, Reader paramReader)
  {
    a(paramInt, paramReader);
    ((PreparedStatement)this.b).setCharacterStream(paramInt, paramReader);
  }
  
  public void setCharacterStream(int paramInt1, Reader paramReader, int paramInt2)
  {
    a(paramInt1, paramReader, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setCharacterStream(paramInt1, paramReader, paramInt2);
  }
  
  public void setCharacterStream(int paramInt, Reader paramReader, long paramLong)
  {
    a(paramInt, paramReader, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setCharacterStream(paramInt, paramReader, paramLong);
  }
  
  public void setClob(int paramInt, Clob paramClob)
  {
    a(paramInt, paramClob);
    ((PreparedStatement)this.b).setClob(paramInt, paramClob);
  }
  
  public void setClob(int paramInt, Reader paramReader)
  {
    a(paramInt, paramReader);
    ((PreparedStatement)this.b).setClob(paramInt, paramReader);
  }
  
  public void setClob(int paramInt, Reader paramReader, long paramLong)
  {
    a(paramInt, paramReader, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setClob(paramInt, paramReader, paramLong);
  }
  
  public void setDate(int paramInt, Date paramDate)
  {
    a(paramInt, paramDate);
    ((PreparedStatement)this.b).setDate(paramInt, paramDate);
  }
  
  public void setDate(int paramInt, Date paramDate, Calendar paramCalendar)
  {
    a(paramInt, paramDate, paramCalendar);
    ((PreparedStatement)this.b).setDate(paramInt, paramDate, paramCalendar);
  }
  
  public void setDouble(int paramInt, double paramDouble)
  {
    a(paramInt, Double.valueOf(paramDouble));
    ((PreparedStatement)this.b).setDouble(paramInt, paramDouble);
  }
  
  public void setFloat(int paramInt, float paramFloat)
  {
    a(paramInt, Float.valueOf(paramFloat));
    ((PreparedStatement)this.b).setFloat(paramInt, paramFloat);
  }
  
  public void setInt(int paramInt1, int paramInt2)
  {
    a(paramInt1, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setInt(paramInt1, paramInt2);
  }
  
  public void setLong(int paramInt, long paramLong)
  {
    a(paramInt, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setLong(paramInt, paramLong);
  }
  
  public void setNCharacterStream(int paramInt, Reader paramReader)
  {
    a(paramInt, paramReader);
    ((PreparedStatement)this.b).setNCharacterStream(paramInt, paramReader);
  }
  
  public void setNCharacterStream(int paramInt, Reader paramReader, long paramLong)
  {
    a(paramInt, paramReader, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setNCharacterStream(paramInt, paramReader, paramLong);
  }
  
  public void setNClob(int paramInt, NClob paramNClob)
  {
    a(paramInt, paramNClob);
    ((PreparedStatement)this.b).setNClob(paramInt, paramNClob);
  }
  
  public void setNClob(int paramInt, Reader paramReader)
  {
    a(paramInt, paramReader);
    ((PreparedStatement)this.b).setNClob(paramInt, paramReader);
  }
  
  public void setNClob(int paramInt, Reader paramReader, long paramLong)
  {
    a(paramInt, paramReader, Long.valueOf(paramLong));
    ((PreparedStatement)this.b).setNClob(paramInt, paramReader, paramLong);
  }
  
  public void setNString(int paramInt, String paramString)
  {
    a(paramInt, paramString);
    ((PreparedStatement)this.b).setNString(paramInt, paramString);
  }
  
  public void setNull(int paramInt1, int paramInt2)
  {
    a(paramInt1, com.taobao.txc.parser.b.c.h.a());
    ((PreparedStatement)this.b).setNull(paramInt1, paramInt2);
  }
  
  public void setNull(int paramInt1, int paramInt2, String paramString)
  {
    a(paramInt1, Integer.valueOf(paramInt2), com.taobao.txc.parser.b.c.h.a());
    ((PreparedStatement)this.b).setNull(paramInt1, paramInt2, paramString);
  }
  
  public void setObject(int paramInt, Object paramObject)
  {
    a(paramInt, paramObject);
    ((PreparedStatement)this.b).setObject(paramInt, paramObject);
  }
  
  public void setObject(int paramInt1, Object paramObject, int paramInt2)
  {
    a(paramInt1, paramObject, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setObject(paramInt1, paramObject, paramInt2);
  }
  
  public void setObject(int paramInt1, Object paramObject, int paramInt2, int paramInt3)
  {
    a(paramInt1, paramObject, Integer.valueOf(paramInt2), Integer.valueOf(paramInt3));
    ((PreparedStatement)this.b).setObject(paramInt1, paramObject, paramInt2, paramInt3);
  }
  
  public void setRef(int paramInt, Ref paramRef)
  {
    a(paramInt, paramRef);
    ((PreparedStatement)this.b).setRef(paramInt, paramRef);
  }
  
  public void setRowId(int paramInt, RowId paramRowId)
  {
    a(paramInt, paramRowId);
    ((PreparedStatement)this.b).setRowId(paramInt, paramRowId);
  }
  
  public void setSQLXML(int paramInt, SQLXML paramSQLXML)
  {
    a(paramInt, paramSQLXML);
    ((PreparedStatement)this.b).setSQLXML(paramInt, paramSQLXML);
  }
  
  public void setShort(int paramInt, short paramShort)
  {
    a(paramInt, Short.valueOf(paramShort));
    ((PreparedStatement)this.b).setShort(paramInt, paramShort);
  }
  
  public void setString(int paramInt, String paramString)
  {
    a(paramInt, paramString);
    ((PreparedStatement)this.b).setString(paramInt, paramString);
  }
  
  public void setTime(int paramInt, Time paramTime)
  {
    a(paramInt, paramTime);
    ((PreparedStatement)this.b).setTime(paramInt, paramTime);
  }
  
  public void setTime(int paramInt, Time paramTime, Calendar paramCalendar)
  {
    a(paramInt, paramTime, paramCalendar);
    ((PreparedStatement)this.b).setTime(paramInt, paramTime);
  }
  
  public void setTimestamp(int paramInt, Timestamp paramTimestamp)
  {
    a(paramInt, paramTimestamp);
    ((PreparedStatement)this.b).setTimestamp(paramInt, paramTimestamp);
  }
  
  public void setTimestamp(int paramInt, Timestamp paramTimestamp, Calendar paramCalendar)
  {
    a(paramInt, paramTimestamp, paramCalendar);
    ((PreparedStatement)this.b).setTimestamp(paramInt, paramTimestamp, paramCalendar);
  }
  
  public void setURL(int paramInt, URL paramURL)
  {
    a(paramInt, paramURL);
    ((PreparedStatement)this.b).setURL(paramInt, paramURL);
  }
  
  public void setUnicodeStream(int paramInt1, InputStream paramInputStream, int paramInt2)
  {
    a(paramInt1, paramInputStream, Integer.valueOf(paramInt2));
    ((PreparedStatement)this.b).setUnicodeStream(paramInt1, paramInputStream, paramInt2);
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.resourcemanager.b.e
 * JD-Core Version:    0.7.0.1
 */